package com.example.controller;

import com.example.pojo.PageBean;
import com.example.pojo.Result;
import com.example.pojo.Stu;
import com.example.service.StuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stuInfo")
public class StuInfoController {

    @Autowired
    private StuInfoService stuInfoService;

    /**
     * 根据学生姓名查询详细信息
     * @param name
     * @return
     */
    @GetMapping
    public Result findStuInfo(@RequestParam Integer pageNum,
                              @RequestParam Integer pageSize,
                              @RequestParam String name){
        PageBean pageBean = stuInfoService.findStuInfo(pageNum,pageSize,name);
        return Result.success(pageBean);
    }
}
